home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Grafik & Text & Film / Quark XTensions / Freeware Xtensions / Quark AppleScript Scripts / Scripts (text only) / Save Pages as EPS Files < prev    next >
Text File  |  1994-05-02  |  2KB  |  62 lines

  1. --Copyright 1994 Quark, Inc.   All rights reserved.
  2.  
  3.  
  4. on open y
  5.     display dialog "Each page of every QuarkXPress™ document dropped on this script will be saved as a Mac Color EPS." buttons {"Cancel", "OK"} default button 2 with icon note
  6.     set destpath to (choose folder with prompt "Select a destination folder for EPS files.") as text
  7.     set x to 1
  8.     set notXDOC to 0
  9.     set numdocs to count of items in y
  10.     repeat number of items in y times
  11.         set docname to item x of y as string
  12.         set z to info for item x of y
  13.         if z is not folder then
  14.             if z's file type is not "XDOC" then
  15.                 set notXDOC to notXDOC + 1
  16.             else
  17.                 tell application "QuarkXPress™"
  18.                     open item x of y use doc prefs yes remap fonts no
  19.                     tell document 1
  20.                         set pagecount to the count of pages
  21.                         if pagecount < 10 then
  22.                             set mfl to 25
  23.                         else if pagecount < 100 then
  24.                             set mfl to 24
  25.                         else if pagecount < 1000 then
  26.                             set mfl to 23
  27.                         else
  28.                             set mfl to 22
  29.                         end if
  30.                         set docname to the name of it
  31.                         if (count of characters in docname) ≤ mfl then
  32.                             set view scale to "100%"
  33.                             repeat with i from 1 to pagecount
  34.                                 save page i EPS format Mac Color include preview "true" EPS data binary EPS OPI ¬
  35.                                     include images in (destpath & docname & "-" & "Page" & i)
  36.                             end repeat
  37.                         else
  38.                             display dialog "The name of this QuarkXPress™ document cannot contain more than " & mfl & ¬
  39.                                 "characters to be processed properly by this script." with icon caution
  40.                         end if
  41.                     end tell
  42.                     close document 1
  43.                 end tell
  44.             end if
  45.             set x to x + 1
  46.         else
  47.             display dialog ¬
  48.                 "The current file is not a QuarkXPress™ document." buttons {"Cancel"} default button 1 with icon stop
  49.         end if
  50.     end repeat
  51.     if notXDOC > 0 then
  52.         if notXDOC = 1 then
  53.             if numdocs = 1 then
  54.                 display dialog "The current file is not a QuarkXPress™ document." buttons {"Cancel"} default button 1 with icon stop
  55.             else
  56.                 display dialog (notXDOC as string) & " of the files was not a QuarkXPress™ document." buttons {"OK"} default button 1 with icon caution
  57.             end if
  58.         else
  59.             display dialog (notXDOC as string) & " of these files were not QuarkXPress™ documents." buttons {"OK"} default button 1 with icon caution
  60.         end if
  61.     end if
  62. end open